/*     */ package nccloud.web.qc.rejectbill.utils;
/*     */ 
/*     */ import java.util.HashSet;
/*     */ import java.util.Set;
/*     */ import nc.pubitf.qc.c002.qc.c003.IQueryForC003;
/*     */ import nc.vo.ml.NCLangRes4VoTransl;
/*     */ import nc.vo.pub.BusinessException;
/*     */ import nc.vo.pubapp.pattern.data.ValueUtils;
/*     */ import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
/*     */ import nc.vo.qc.c002.entity.CheckBillViewVO;
/*     */ import nc.vo.qc.c002.util.FakeCheckBillUtil;
/*     */ import nc.vo.qc.c004.entity.RejectBillVO;
/*     */ import nccloud.base.exception.ExceptionUtils;
/*     */ import nccloud.framework.core.util.ArrayUtils;
/*     */ import nccloud.framework.service.ServiceLocator;
/*     */ import nccloud.framework.web.ui.pattern.billcard.BillCard;
/*     */ import nccloud.framework.web.ui.pattern.extbillcard.ExtBillCard;
/*     */ import nccloud.framework.web.ui.pattern.grid.Grid;
/*     */ import nccloud.framework.web.ui.pattern.grid.GridOperator;
/*     */ import nccloud.web.qc.pub.entity.CheckInfoMultiTabDTO;
/*     */ import nccloud.web.qc.pub.reportandrejectbill.CheckInfoTabClientAdapter;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class RejectBillUtils
/*     */ {
/*     */   public static CheckInfoMultiTabDTO createCheckInfoMultiTab(BillCard retcard, RejectBillVO vo, String[] areacode) {
/*  39 */     CheckBillViewVO[] checkviews = null;
/*  40 */     String hid = getPk_applybill(vo);
/*  41 */     String chkbat = getPk_chkbatch(vo);
/*  42 */     //checkviews = queryCheckBillViewVO(hid, chkbat);
/*     */     
/*  44 */     Grid checkInfoGrid = null;
/*  45 */     if (ArrayUtils.isNotEmpty(checkviews)) {
/*  46 */       GridOperator gridOperator = new GridOperator(areacode[3]);
/*  47 */       gridOperator.setBodycode(areacode[0]);
/*  48 */       checkInfoGrid = gridOperator.toGrid(checkviews);
/*     */     } 
/*  50 */     ExtBillCard ret = bulidExtBillCard(checkInfoGrid, retcard);
/*  51 */     CheckInfoTabClientAdapter adapter = new CheckInfoTabClientAdapter(checkviews, areacode[1], areacode[2]);
/*  52 */     CheckInfoMultiTabDTO dto = adapter.buildDTOwithTabs();
/*  53 */     dto.setBill(ret);
/*  54 */     return dto;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private static String getPk_chkbatch(AbstractBill bill) {
/*  63 */     RejectBillVO rejectbill = (RejectBillVO)bill;
/*  64 */     return rejectbill.getHVO().getPk_chkbatch();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private static String getPk_applybill(AbstractBill bill) {
/*  74 */     RejectBillVO rejectbill = (RejectBillVO)bill;
/*  75 */     return rejectbill.getHVO().getPk_applybill();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private static CheckBillViewVO[] queryCheckBillViewVO(String hid, String pk_chkbatch) {
/*  86 */     CheckBillViewVO[] retviews = null;
/*     */     try {
/*  88 */       IQueryForC003 sr = (IQueryForC003)ServiceLocator.find(IQueryForC003.class);
/*  89 */       retviews = sr.queryChkBillByApplyIDAndBatch(hid, pk_chkbatch);
/*  90 */     } catch (BusinessException ex) {
/*  91 */       ExceptionUtils.wrapException(ex);
/*     */     } 
/*     */     
/*  94 */     retviews = (retviews == null) ? new CheckBillViewVO[0] : retviews;
/*  95 */     Set<String> bdealedHids = new HashSet<String>();
/*  96 */     for (CheckBillViewVO view : retviews) {
/*  97 */       if (ValueUtils.getBoolean(view.getHVO().getBrecheck()))
/*     */       {
/*     */         
/* 100 */         if (!bdealedHids.contains(view.getHVO().getPk_checkbill())) {
/*     */ 
/*     */           
/* 103 */           String voldsample = FakeCheckBillUtil.getSampleCode(view);
/*     */           
/* 105 */           String flag = NCLangRes4VoTransl.getNCLangRes().getStrByID("c010009_0", "0c010009-0016");
/*     */           
/* 107 */           view.getHVO().setVsamplecode(voldsample + flag);
/* 108 */           view.getBVO().setVbsamplecode(voldsample + flag);
/* 109 */           bdealedHids.add(view.getHVO().getPk_checkbill());
/*     */         }  } 
/* 111 */     }  return retviews;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private static ExtBillCard bulidExtBillCard(Grid grid, BillCard billCard) {
/* 121 */     ExtBillCard retcard = new ExtBillCard();
/* 122 */     retcard.setHead(billCard.getHead());
/* 123 */     retcard.setPageid(billCard.getPageid());
/* 124 */     retcard.addBody(billCard.getBody());
/* 125 */     if (null != grid) {
/* 126 */       retcard.addBody(grid);
/*     */     }
/* 128 */     return retcard;
/*     */   }
/*     */ }


/* Location:              E:\zhuhai_ncc\NCC2111\external\li\\uiqc_nccloud.jar!/nccloud/web/qc/rejectbill/utils/RejectBillUtils.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.0.7
 */